package com.coder520.sync_learning.demo;

import java.util.concurrent.TimeUnit;

/**
 * @author zhaoyibo
 *
 */
public class ThreadInterrupt {
	public static void main(String[] args) throws InterruptedException {
		Thread thread=new Thread(()->{
			try {
				TimeUnit.MINUTES.sleep(1);
			} catch (InterruptedException e) {
				// TODO: handle exception
				System.out.println("我被打断了");
			}
		});
		
		thread.start();
		
		TimeUnit.MILLISECONDS.sleep(2);
		
		
		thread.interrupt();
	}
}
